import request from '@/utils/request'
import { getMiniAppId } from '@/utils/index'
// 渠道列表
export function channelIndex(data) {
  return request({
    url: '/admin/channel/index',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 渠道删除
export function channelDel(data) {
  return request({
    url: '/admin/channel/del',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 渠道配置列表
export function channelPlayletIndex(data) {
  return request({
    url: '/admin/channel/channelPlayletIndex',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 收费配置保存
export function channelPlayletSave(data) {
  return request({
    url: '/admin/channel/channelPlayletSave',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 收费配置删除
export function channelPlayletDel(data) {
  return request({
    url: '/admin/channel/channelPlayletDel',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 模版列表
export function channelTemplateIndex(data) {
  return request({
    url: '/admin/channel/channelTemplateIndex',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 模版选择保存
export function channelTemplateSave(data) {
  return request({
    url: '/admin/channel/channelTemplateSave',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 模板预览
export function templatePreview(data) {
  return request({
    url: '/admin/channel/templatePreview',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 公共接口 channel渠道，memberId用户ID，miniApp小程序，merchant商户号，playlet短剧，chapter剧集，playletStatus短剧展示位置
export function MiniAppIdcommonData(data) {
  return request({
    url: '/admin/searchcondition/search',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 渠道数据
export function channelData(data) {
  return request({
    url: '/admin/channel/channelStats',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 设置引流规则
export function flowRule(data) {
  return request({
    url: '/admin/channel/flowRule',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 关注加群开关
export function flowSwitch(data) {
  return request({
    url: '/admin/channel/flowSwitch',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 关注加群开关
export function adSwitch(data) {
  return request({
    url: '/admin/channel/adSwitch',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 批量修改收费配置
export function batchChannelPlayletSave(data) {
  return request({
    url: '/admin/channel/batchChannelPlayletSave',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 批量模版选择保存
export function batchChannelTemplateSave(data) {
  return request({
    url: '/admin/channel/batchChannelTemplateSave',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 优先激励广告开关
export function batchChannelfirstRewardAd(data) {
  return request({
    url: '/admin/channel/firstRewardAd',
    method: 'post',
    data: getMiniAppId(data)
  })
}

// 批量关注加群
export function batchchannelbatchFlowSwitch(data) {
  return request({
    url: '/admin/channel/batchFlowSwitch',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 官方播放器开关
export function playerSwitch(data) {
  return request({
    url: '/admin/channel/playerSwitch',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 拼团设置的开关
export function groupBuySwitch(data) {
  return request({
    url: '/admin/channel/groupBuySwitch',
    method: 'post',
    data: getMiniAppId(data)
  })
}

